package com.itsc.service;

import java.util.List;

import com.itsc.dao.CenterImageDesDao;
import com.itsc.entities.CenterImageDes;
import com.itsc.service.inter.ICenterImageDesService;
import com.itsc.util.page.Page;

public class CenterImageDesService implements ICenterImageDesService{

	private CenterImageDesDao centerImageDesDao;
	public void setCenterImageDesDao(CenterImageDesDao centerImageDesDao) {
		this.centerImageDesDao = centerImageDesDao;
	}
	@Override
	public void save(CenterImageDes centerImageDes) {
		// TODO Auto-generated method stub
		centerImageDesDao.save(centerImageDes);
	}

	@Override
	public void delete(CenterImageDes centerImageDes) {
		// TODO Auto-generated method stub
		centerImageDesDao.delete(centerImageDes);
	}

	@Override
	public CenterImageDes selectById(Integer id) {
		// TODO Auto-generated method stub
		String hql = "from CenterImageDes where cid_id=?";
		CenterImageDes centerimagedes = centerImageDesDao.selectById(hql, id);
		return centerimagedes;
	}

	@Override
	public void update(CenterImageDes centerImageDes) {
		// TODO Auto-generated method stub
		centerImageDesDao.update(centerImageDes);
	}

	@Override
	public List<CenterImageDes> selectAll() {
		// TODO Auto-generated method stub
		String hql = "from CenterImageDes";
		List<CenterImageDes> list = centerImageDesDao.selectAll(hql);
		return list;
	}
	@Override
	public List<CenterImageDes> getPage(Page page) {
		// TODO 自动生成的方法存根
		String hql = "from CenterImageDes";
		return centerImageDesDao.getPage(hql, page);
	}
	@Override
	public int getCount() {
		// TODO 自动生成的方法存根
		String hql = "select count(*) from CenterImageDes";
		return centerImageDesDao.getCount(hql);
	}
	@Override
	public int getCount(String searchname) {
		// TODO 自动生成的方法存根
		return centerImageDesDao.search(searchname, null).size();
	}
	@Override
	public List<CenterImageDes> search(String searchname, Page page) {
		// TODO 自动生成的方法存根
		return centerImageDesDao.search(searchname, page);
	}
	public Boolean checkDepartment(String name) {
		// TODO Auto-generated method stub
		Boolean flag = centerImageDesDao.checkDepartment(name);
		return flag;
	}
	@Override
	public Integer checkIdByDepartment(String name) {
		// TODO Auto-generated method stub
		Integer id = centerImageDesDao.checkIdByDepartment(name);
		return id;
	}
	
}
